import pyb

class Digital():
    def __init__(self,type,p_list):
        if type:
            self.tab = [0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x88,0x83,0xc6,0xa1,0x86,0x8e]
        else:
            self.tab = [0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71]
        self.pins = p_list

    def display(self,data):
        a=self.tab[data]
        for i in self.pins:
            b=a&1
            a>>=1
            i.value(b)